#ifndef _INTERRUPT_H_
#define _INTERRUPT_H_


/*
	class : Interrupt
	desc : This is a class that is really more
		to help generalize interrupts into a format
		that can make them easier (hopefully) to use and understand
		if needed. How or what you do in the interrupt itself
		is up to you but the interface can make it a little easier
		to understand and more readable to use which can be a great 
		benefit if it is a new interrupt that you are unfamiliar with
		and experimenting with. Realistically, you shouldn't need to use
		this class for anything but the formatting and naming should hopefully
		make any code you write using applications easier to understand and test
*/
class Interrupt
{
	public:

		//the interrupt service routine that this interrupt uses
		//to execute the code.
		virtual void isr()=0;
		//enables the interrupt.
		virtual void enable()=0;
		//disables the interrupt
		virtual void disable()=0;
		//starts the interrupt to be performed. This is more for cases where
		//even if the interrupt is enabled an action needs to be performed to 
		//to actually get the interrupt to start. For instance, if you use the atmega32
		//usart to receive more data you have to read the UDR register before the next 
		//receive interrupt can start at least.
		virtual void start()=0;
		//stops the interrupt from being performed. This is the reverse case of start. If
		// processing is midway for an interrupt then stop must clear out that processing
		//accordingly so it doesn't interfere with the next interrupt.
		virtual void stop()=0;
		//triggers the interrupt to occur without any processing in the middle to occur.
		//If trigger is used then you should expect the isr to run immediately after trigger
		//is executed. This is different from start and stop since start and stop expect there
		//to be some unrelated instructions in between the call between start and the isr or the
		//stop call.
		virtual void trigger()=0;
};


#endif
